package com.yuncheng.oaApi.constant;


import org.springframework.stereotype.Component;

@Component("OaXcxxspFlowConstant")
public class OaXcxxspOaFlowConstants implements OaFlowConstants {
    public final static String LCMC_LIKE_OALC = "自治区食品药品审评查验中心网站信息发布审批表";

    public final static String NODENAME ="申请,科室审批,办公室审批,中心分管领导审批,中心主任审批,信息发布办理";

    public final static String HJMC_SQ="申请";
    public final static String HJMC_KSSP="科室审批";
    public final static String HJMC_BGSSSP="办公室审批";
    public final static String HJMC_FGLDSP="中心分管领导审批";
    public final static String HJMC_DWLDSP="中心主任审批";
    public final static String HJMC_XXFBBL="信息发布办理";

    // 流程办理按钮类型 - 保存
    public final static String SUBMIT_TYPE_SAVE = "0";

    // 流程办理按钮类型 - 提交
    public final static String SUBMIT_TYPE_SUBMIT = "1";

    // 获取第一环节
    public String getFirstNode() {
        String nodeNameList[] = NODENAME.split(",");
        return nodeNameList[0];
    }


    //办理方式
    public String getBlfs(String nodeName) {
        return OaCommonFlowConstant.BLFS_DRJJ;
    }

    //流程编码
    @Override
    public String getFywflcode() {
        return "oaxcxxspgl001";
    }

    //获取流程名称
    @Override
    public String getFlowName() {
        return "自治区食品药品审评查验中心网站信息发布审批表";
    }

    // 获取下环节名称
    public String getNextNodeName(String nowNodeName) {
        String nodeNameList[] = NODENAME.split(",");
        for (int i = 0; i < nodeNameList.length; i++) {
            if (nodeNameList[i].equals(nowNodeName)) {
                if (i == nodeNameList.length - 1) {
                    return HJMC_LCJS;
                } else {
                    return nodeNameList[i + 1];
                }
            }
        }
        return "";
    }

    // 获取上一个环节名称
    public String getPreviousName(String nowNodeName) {
        String[] nodeNameList = NODENAME.split(",");

        for (int i = 0; i < nodeNameList.length; i++) {
            if (nodeNameList[i].equals(nowNodeName)) {
                if (i == 0) {
                    return nodeNameList[i];
                } else {
                    int perviousI = i - 1; // 上一个环节名称
                    return nodeNameList[perviousI];
                }
            }
        }
        return "";
    }

    // 获取审评下环节名称
    public String getSpNextNodeName(String nowNodeName) {

        return null;
    }

    // 获取审评上环节名称
    public String getSpPreviousName(String nowNodeName) {

        return null;
    }

}
